<div>
  <el-row>
    <el-col :span="24" style="text-align: right" >
      <el-button size="medium" type="primary" @click="dialogAddItemVisible = true" >添加记录</el-button>
    </el-col>
  </el-row>

  <el-row :gutter="20">
    <el-col :span="5" >
      <el-card class="box-card" style="height: 500px" >
        <div slot="header" class="clearfix">
          <span>计划详情</span>
        </div>

        <div class="text item" >
          <el-row>
            <el-col :span="12" >当前资产</el-col>
            <el-col :span="12" >1300232.23</el-col>
          </el-row>

          <el-row>
            <el-col :span="12" >总收益率</el-col>
            <el-col :span="12" >63.33%</el-col>
          </el-row>

          <el-row>
            <el-col :span="12" >年化收益率</el-col>
            <el-col :span="12" >25.33%</el-col>
          </el-row>

          <el-row>
            <el-col :span="12" >开始时间</el-col>
            <el-col :span="12" >2017-03-12</el-col>
          </el-row>

          <el-row>
            <el-col :span="12" >结束时间</el-col>
            <el-col :span="12" >至今</el-col>
          </el-row>

        </div>
      </el-card>
    </el-col>

    <el-col :span="19" >
      <el-card class="box-card" style="height: 500px" >
        <div class="text item" >
          <chart-component></chart-component>
        </div>
      </el-card>
    </el-col>
  </el-row>


  <el-dialog title="添加成交" :visible.sync="dialogAddItemVisible">
    <el-form :model="form">
      <el-form-item label="买入方式" :label-width="formLabelWidth">
        <el-select v-model="form.type" placeholder="请选择买入方式">
          <el-option label="每月定投" value="month" ></el-option>
          <el-option label="每周定投" value="week" ></el-option>
          <el-option label="季度定投" value="quarter" ></el-option>
          <el-option label="年度定投" value="year" ></el-option>
          <el-option label="自定义买入" value="other" ></el-option>
        </el-select>
      </el-form-item>

      <el-form-item :label-width="formLabelWidth">
        <el-button size="medium" type="primary" @click="onAddSubject()" >添加标的</el-button>
      </el-form-item>

      <template v-for="(item, index) of form.list" >

        <el-form-item label="买入标的" :label-width="formLabelWidth" >
          <el-input v-model="item.code" autocomplete="off" placeholder="请输入标旳代码" ></el-input>
        </el-form-item>

        <el-form-item label="买入市值" :label-width="formLabelWidth" >
          <el-input type="number" v-model="item.value" autocomplete="off" placeholder="请输入标的市值 (按市价买入)" ></el-input>
        </el-form-item>

        <el-form-item label="买入股数" :label-width="formLabelWidth" >
          <el-input type="number" v-model="item.count" autocomplete="off" placeholder="请输入买入股数 (和市值相斥)" ></el-input>
        </el-form-item>
      </template>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogAddItemVisible = false">取 消</el-button>
      <el-button type="primary" @click="onAddItem()">确 定</el-button>
    </div>
  </el-dialog>
</div>
